<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>{{ $books->book_name }}(夜读书)</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="author" content="夜读书">
    <meta name="description" content="夜读书中文网">
    <meta name="keywords" content="{{ $books->book_name }},isbn:{{ $books->isbn }},读书,阅读,小说,文学">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/yds.css') }}">
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
    <link rel="stylesheet" href="{{ asset('/style/css/dialog.css') }}">
    <script src="{{ asset('/scripts/dialog.js') }}"></script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('/scripts/reglgdialog.js') }}"></script>
    {{-- umeditor --}}
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/ueditor.config.js') }}"></script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/ueditor.all.js') }}"> </script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/lang/zh-cn/zh-cn.js') }}"></script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/ajaxcheck.js') }}"></script>
    {{-- umeditor end --}}
</head>
<body class="docs">
@include('books.partials.navtop')
@include('books.partials.nav')

<div class="docs-wrapper container">
  
  <div class="binfo">
  <div class="subjectwrap">
    <div class="infotitle"><h1>{{ $books->book_name }}</h1></div>
    <div class="info clearfix">            
        <div class="indent">
                <a href="{{ asset($books->bimg) }}" target="_blank">
                <img src="{{ asset($books->bimg) }}">
                </a>
        </div>
        <div class="info1">
              @if($books->yuanzuoming!="") <span class="p1">原作名:{{ $books->yuanzuoming }}</span><br> @endif
              @if($books->fubiaoti!="")    <span class="p1">副标题:{{ $books->fubiaoti }}</span><br>    @endif
              @if($books->zuozhe!="")      <span class="p1">作者:{{ $books->zuozhe }}</span><br>        @endif
              @if($books->yizhe!="")       <span class="p1">译者:{{ $books->yizhe }}</span><br>         @endif
              @if($books->chubanshe!="")   <span class="p1">出版社:{{ $books->chubanshe }}</span><br>   @endif
              @if($books->chubannian!="")  <span class="p1">出版年:{{ $books->chubannian }}</span><br>  @endif
              @if($books->yeshu!="")       <span class="p1">页数:{{ $books->yeshu }}</span><br>         @endif
              @if($books->dingjia!="")     <span class="p1">定价:{{ $books->dingjia }}</span><br>       @endif
              @if($books->zhuangzhen!="")  <span class="p1">装帧:{{ $books->zhuangzhen }}</span><br>    @endif
              @if($books->congshu!="")     <span class="p1">丛书:{{ $books->congshu }}</span><br>       @endif
              @if($books->isbn!="")        <span class="p1">ISBN:{{ $books->isbn }}</span><br>          @endif
        </div>        
    </div>
    <div id="interest_sectl">
        <div class="rating_wrap">
            <div class="rating_logo">夜读书评分</div>
            
            <div class="rating_self clearfix">
            @if($pf!=0 && $pingfeninfo->rencount>=10)
                <strong class="rating_num">{{$pingfeninfo->fenshu}}</strong>
                <div class="rating_right">
                @if($pingfeninfo->fenshu >= 0 && $pingfeninfo->fenshu < 1)
                    <div class="bigstar05"></div>
                @endif
                @if($pingfeninfo->fenshu >= 1 && $pingfeninfo->fenshu < 2)
                    <div class="bigstar10"></div>
                @endif
                @if($pingfeninfo->fenshu >= 2 && $pingfeninfo->fenshu < 3)
                    <div class="bigstar15"></div>
                @endif
                @if($pingfeninfo->fenshu >= 3 && $pingfeninfo->fenshu < 4)
                    <div class="bigstar20"></div>
                @endif
                @if($pingfeninfo->fenshu >= 4 && $pingfeninfo->fenshu < 5)
                    <div class="bigstar25"></div>
                @endif
                @if($pingfeninfo->fenshu >= 5 && $pingfeninfo->fenshu < 6)
                    <div class="bigstar30"></div>
                @endif
                @if($pingfeninfo->fenshu >= 6 && $pingfeninfo->fenshu < 7)
                    <div class="bigstar35"></div>
                @endif
                @if($pingfeninfo->fenshu >= 7 && $pingfeninfo->fenshu < 8)
                    <div class="bigstar40"></div>
                @endif
                @if($pingfeninfo->fenshu >= 8 && $pingfeninfo->fenshu < 9)
                    <div class="bigstar45"></div>
                @endif
                @if($pingfeninfo->fenshu >= 9 && $pingfeninfo->fenshu <= 10)
                    <div class="bigstar50"></div>
                @endif
                    <div class="rating_sum">
                        <span class=""><a href="">{{$pingfeninfo->rencount}}人评分</a></span>
                    </div>
                </div>
            @else
            <div class="rating_right">
                <div class="bigstar00"></div>
                <div class="rating_sum">
                    <span class=""><a href="">评分人数不足</a></span>
                </div>
            </div>
            @endif
            </div>
            @if($pf!=0)
            <span class="stars5 starstop" title="力荐">5星</span>
            <div class="power" style="width: {{$pingfeninfo->star5*0.6}}px;"></div>
            <span class="rating_per">{{$pingfeninfo->star5}}%</span>
            <br/>
            <span class="stars5 starstop" title="推荐">4星</span>
            <div class="power" style="width: {{$pingfeninfo->star4*0.6}}px;"></div>
            <span class="rating_per">{{$pingfeninfo->star4}}%</span>
            <br/>
            <span class="stars5 starstop" title="还行">3星</span>
            <div class="power" style="width: {{$pingfeninfo->star3*0.6}}px;"></div>
            <span class="rating_per">{{$pingfeninfo->star3}}%</span>
            <br/>
            <span class="stars5 starstop" title="较差">2星</span>
            <div class="power" style="width: {{$pingfeninfo->star2*0.6}}px;"></div>
            <span class="rating_per">{{$pingfeninfo->star2}}%</span>
            <br/>
            <span class="stars5 starstop" title="很差">1星</span>
            <div class="power" style="width: {{$pingfeninfo->star1*0.6}}px;"></div>
            <span class="rating_per">{{$pingfeninfo->star1}}%</span>
            @else
            <span class="stars5 starstop" title="力荐">5星</span>
            <div class="power" style="width: 0px;"></div>
            <span class="rating_per">0.0%</span>
            <br/>
            <span class="stars5 starstop" title="推荐">4星</span>
            <div class="power" style="width: 0px;"></div>
            <span class="rating_per">0.0%</span>
            <br/>
            <span class="stars5 starstop" title="还行">3星</span>
            <div class="power" style="width: 0px;"></div>
            <span class="rating_per">0.0%</span>
            <br/>
            <span class="stars5 starstop" title="较差">2星</span>
            <div class="power" style="width: 0px;"></div>
            <span class="rating_per">0.0%</span>
            <br/>
            <span class="stars5 starstop" title="很差">1星</span>
            <div class="power" style="width: 0px;"></div>
            <span class="rating_per">0.0%</span>
            @endif
        </div>
    </div>
  </div>
    @if(Session::has('name') && $ispingfen!=0)
    <div class="interest_sect_level">
        <div class="read-state">
            <span class="">
            @if($bookspingfen->read_state == 1)
            我想读这本书 @if($bookspingfen->private==1)(私人收藏)@endif
            @endif
            @if($bookspingfen->read_state == 2)
            我最近在读这本书 @if($bookspingfen->private==1)(私人收藏)@endif
            @endif
            @if($bookspingfen->read_state == 3)
            我读过这本书 @if($bookspingfen->private==1)(私人收藏)@endif
            @endif
            </span>
            <span>
            <a href="javascript:void(0)" class="read-edit">修改</a> 
            <a href="{{$books->book_id}}/pfremove" title="删除这个收藏" onclick="javascript:return r_remove()">删除</a>
            </span>       
        </div>
        @if($bookspingfen->rating!=0)
        <div class="rating">
        <span class="">我的评价:<span class="bigstar{{$bookspingfen->rating}}0"></span></span>
        </div>
        @endif
        <div class="memo">
        <span>@if($bookspingfen->memo!="")备注: {{$bookspingfen->memo}}@endif</span>
        </div>
    </div>
    @else    
    <div class="interest_sect_level">
        @if(Session::has('name'))
        <button type="button" class="btn btn-default btn-xs want">想读</button>
        <button type="button" class="btn btn-default btn-xs reading">在读</button>
        <button type="button" class="btn btn-default btn-xs read">读过</button>
        @else
        <button type="button" class="btn btn-default btn-xs reglgdialog">想读</button>
        <button type="button" class="btn btn-default btn-xs reglgdialog">在读</button>
        <button type="button" class="btn btn-default btn-xs reglgdialog">读过</button>
        @endif
    </div>    
    @endif
    <div class="xsp"><span class="subject_menu"><img src="{{asset('images/add-review.gif')}}"><a href="{{$books->book_id}}/newbookreview">写长书评或读后感</a></img></span></div>
    <div class="infoline"></div>
        <div class="related_info">
          	<span class="p1">内容简介 · · · · · ·</span>
          	<div class="neirong">{!! $books->neirongjianjie !!}</div>
          	<span class="p1">作者简介 · · · · · ·</span>
          	<div class="zuozhe">{!! $books->zuozhejianjie !!}</div>
          	<span class="p1">目录 · · · · · ·</span>
          	<div class="mulu">{!! $books->mulu !!}</div>
            {{-- 书评列表 --}}
        @if(count($bookscomments)!=0)
        <div class="aw-mod aw-question-comment">
          <div class="mod-head">
            <span class="p1">短评 · · · · · ·</span>
          </div>
        </div>
        @endif
        @foreach($bookscomments as $bookscomment)
          <div class="mod-body aw-feed-list">
            <div class="aw-item">
              <div class="mod-head">
                <a class="aw-user-img aw-border-radius-5" href="{{url('u')}}/{{$bookscomment->users->uid}}">
                @if($bookscomment->users->avatar_file!="")
                  <img src="http://www.yedushu.com/topics/uploads/avatar/{{ $bookscomment->users->avatar_file }}">
                @else
                  <img src="http://www.yedushu.com/topics/static/common/avatar-mid-img.png">
                @endif
                </a>
                <div class="title">
                  <p><a class="aw-user-name" href="{{url('u')}}/{{$bookscomment->users->uid}}">{{ $bookscomment->users->user_name }}</a></p>
                </div>
                <div class="mod-body clearfix">
                  <div class="markitup-box">{!! $bookscomment->message !!}</div>
                </div>
                <div class="mod-footer">
                  <div class="meta clearfix">
                    <span class="text-color-999 pull-right">{{date('Y-m-d H:i',$bookscomment->add_time)}}</span>
                  </div>
                </div>
              </div>
            </div>              
          </div>   
        @endforeach       
        {{-- 书评列表 end--}}
        {{-- 回复编辑器 --}}
        @if(Session::has('name'))
        <div class="aw-mod aw-replay-box question">
            <form id="form" role="form" action="{{ asset('bookscomments') }}" method="post">
            <input type="hidden" name="_token" value="{{ csrf_token() }}" />
            <input type="hidden" name="bookid" id="bookid" value="{{ $books->book_id }}" />
              <div class="mod-head">
                <a class="aw-user-name" href="{{url('u')}}/{{$users->uid}}">
                @if($users->avatar_file!="")
                <img src="http://www.yedushu.com/topics/uploads/avatar/{{ $users->avatar_file }}">
                @else
                <img src="http://www.yedushu.com/topics/static/common/avatar-mid-img.png">
                @endif
                </a>
                <p><a href="{{url('u')}}/{{$users->uid}}">{{ $users->user_name }}</a></p>
              </div>
                <div class="form-group">
                    <script id="editor" name="message" type="text/plain" style="width:100%;height:70px;"></script>
                    <script type="text/javascript">
                    //实例化编辑器                    
                    var ue = UE.getEditor('editor');
                    </script>
                </div>
                <div class="mod-body-button">
                    <span id="ms"></span>
                    <button type="button" id="spbutton" class="btn btn-success">发表短评</button>
                </div>             
            </form>
        </div>
        {{-- 回复编辑器 end--}}
        @else
        {{-- 书评 --}}
        <div class="aw-mod aw-replay-box question">
            <p align="center">要发表书评请先<a href="{{asset('uslogin')}}">登录</a>或<a href="{{asset('usreg')}}">注册</a></p>
        </div>
        @endif 
        {{-- 书评 end--}} 
        </div>        
    </div>
      <section class="bsidebar">
        @include('books.partials.right')
        @include('books.partials.lianmeng')
      </section> 
</div>

@if(Session::has('name'))
{{-- 弹出对话框 想读 dialog --}}
<div class="dialog-popover dialog-want">
    <div class="dialog-poptit">
        <a title="关闭" class="close">×</a>
        <h3>添加收藏：我想读这本书</h3>
    </div>
    <form class="" name="read-want" id="read-want" action="{{url('savereadwant')}}" method="post">
    <input type="hidden" name="_token" value="{{ csrf_token() }}" />
    <input type="hidden" name="bookid-want" value="{{ $books->book_id }}" />
    <div class="dialog-content">
            <div class="memo_tit">简短备注：</div>
            <div class="">
                <textarea id="memo-want" name="memo-want" maxlength="300" rows="6"></textarea>
            </div>
            <div class=""><input type="checkbox" name="private-want"></input><span class="p1">仅自己可见</span></div>           
    </div>
    <div class="dialog-foot">
        <div class="save"><button type="submit" class="btn btn-success btn-sm" id="savebutton-want">保存</button></div>
    </div>
    </form>
</div>
{{-- 弹出对话框 最近在读 dialog --}}
<div class="dialog-popover dialog-reading">
    <div class="dialog-poptit">
        <a title="关闭" class="close">×</a>
        <h3>添加收藏：我最近在读这本书</h3>
    </div>
    <form class="" name="reading" id="reading" action="{{url('savereading')}}" method="post">
    <input type="hidden" name="_token" value="{{ csrf_token() }}" />
    <input type="hidden" name="bookid-reading" value="{{ $books->book_id }}" />
    <div class="dialog-content">    
        <div class="rate_stars">给本书评分：</div>
            <div class="rate_li">
                <label title="很差"><input type="radio" name="rating-reading" id="rating-reading" value="1"><span class="bigstar10"></span></label>
                <label title="较差"><input type="radio" name="rating-reading" id="rating-reading" value="2"><span class="bigstar20"></span></label>
                <label title="还行"><input type="radio" name="rating-reading" id="rating-reading" value="3"><span class="bigstar30"></span></label>
                <label title="推荐"><input type="radio" name="rating-reading" id="rating-reading" value="4"><span class="bigstar40"></span></label>
                <label title="力荐"><input type="radio" name="rating-reading" id="rating-reading" value="5"><span class="bigstar50"></span></label>
            </div>
            <div class="memo_tit">简短备注：</div>
            <div class="">
                <textarea id="memo-reading" name="memo-reading" maxlength="300"></textarea>
            </div>
            <div class=""><input type="checkbox" name="private-reading"></input><span class="p1">仅自己可见</span></div>           
    </div>
    <div class="dialog-foot">
        <div class="save"><span class="ms-reading"></span><button type="button" class="btn btn-success btn-sm" id="savebutton-reading">保存</button></div>
    </div>
    </form>
</div>
{{-- 弹出对话框 读过 dialog --}}
<div class="dialog-popover dialog-read">
    <div class="dialog-poptit">
        <a title="关闭" class="close">×</a>
        <h3>添加收藏：我读过这本书</h3>
    </div>
    <form class="" name="read" id="read" action="{{url('saveread')}}" method="post">
    <input type="hidden" name="_token" value="{{ csrf_token() }}" />
    <input type="hidden" name="bookid-read" value="{{ $books->book_id }}" />
    <div class="dialog-content">    
        <div class="rate_stars">给本书评分：</div>
            <div class="rate_li">
                <label title="很差"><input type="radio" name="rating-read" id="rating-read" value="1"><span class="bigstar10"></span></label>
                <label title="较差"><input type="radio" name="rating-read" id="rating-read" value="2"><span class="bigstar20"></span></label>
                <label title="还行"><input type="radio" name="rating-read" id="rating-read" value="3"><span class="bigstar30"></span></label>
                <label title="推荐"><input type="radio" name="rating-read" id="rating-read" value="4"><span class="bigstar40"></span></label>
                <label title="力荐"><input type="radio" name="rating-read" id="rating-read" value="5"><span class="bigstar50"></span></label>
            </div>
            <div class="memo_tit">简短备注：</div>
            <div class="">
                <textarea id="memo-read" name="memo-read" maxlength="300"></textarea>
            </div>
            <div class=""><input type="checkbox" name="private-read"></input><span class="p1">仅自己可见</span></div>           
    </div>
    <div class="dialog-foot">
        <div class="save"><span class="ms-read"></span><button type="button" class="btn btn-success btn-sm" id="savebutton-read">保存</button></div>
    </div>
    </form>
</div>
@if(Session::has('name') && $ispingfen!=0)
{{-- 弹出对话框 修改 dialog --}}
<div class="dialog-popover dialog-edit">
    <div class="dialog-poptit">
        <a title="关闭" class="close">×</a>
        <h3>添加收藏：修改</h3>
    </div>
    <form class="" name="edit" id="edit" action="{{url('savereadedit')}}" method="post">
    <input type="hidden" name="_token" value="{{ csrf_token() }}" />
    <input type="hidden" name="bookid-edit" value="{{ $books->book_id }}" />
    <div class="dialog-content">
      <div class="radio">
          <label id="want-edit"><input type="radio" name="read-state" id="read-state" value="1" @if($bookspingfen->read_state == 1) checked @endif>想读</label>
          <label id="reading-edit"><input type="radio" name="read-state" id="read-state" value="2" @if($bookspingfen->read_state == 2) checked @endif>在读</label>
          <label id="read-edit"><input type="radio" name="read-state" id="read-state" value="3" @if($bookspingfen->read_state == 3) checked @endif>读过</label>
      </div>
        <div class="rate_stars"><span class="pftit-edit">@if($bookspingfen->rating == 0)未读书籍暂不能评分：@else给本书评分：@endif</span></div>
            <div class="rate_li-edit">
                <label title="很差"><input type="radio" name="rating-edit" id="rating-edit" value="1" @if($bookspingfen->read_state == 1) disabled="" @endif @if($bookspingfen->rating == 1) checked @endif><span class="star1">@if($bookspingfen->rating == 0)<span class="bigstar00"></span>@else<span class="bigstar10"></span>@endif</span></label>
                <label title="较差"><input type="radio" name="rating-edit" id="rating-edit" value="2" @if($bookspingfen->read_state == 1) disabled="" @endif @if($bookspingfen->rating == 2) checked @endif><span class="star2">@if($bookspingfen->rating == 0)<span class="bigstar00"></span>@else<span class="bigstar20"></span>@endif</span></label>
                <label title="还行"><input type="radio" name="rating-edit" id="rating-edit" value="3" @if($bookspingfen->read_state == 1) disabled="" @endif @if($bookspingfen->rating == 3) checked @endif><span class="star3">@if($bookspingfen->rating == 0)<span class="bigstar00"></span>@else<span class="bigstar30"></span>@endif</span></label>
                <label title="推荐"><input type="radio" name="rating-edit" id="rating-edit" value="4" @if($bookspingfen->read_state == 1) disabled="" @endif @if($bookspingfen->rating == 4) checked @endif><span class="star4">@if($bookspingfen->rating == 0)<span class="bigstar00"></span>@else<span class="bigstar40"></span>@endif</span></label>
                <label title="力荐"><input type="radio" name="rating-edit" id="rating-edit" value="5" @if($bookspingfen->read_state == 1) disabled="" @endif @if($bookspingfen->rating == 5) checked @endif><span class="star5">@if($bookspingfen->rating == 0)<span class="bigstar00"></span>@else<span class="bigstar50"></span>@endif</span></label>
            </div>
            <div class="memo_tit">简短备注：</div>
            <div class="">
                <textarea id="memo-edit" name="memo-edit" maxlength="300">{{$bookspingfen->memo}}</textarea>
            </div>
            <div class=""><input type="checkbox" name="private-edit" @if($bookspingfen->private == 1) checked @endif></input><span class="p1">仅自己可见</span></div>           
    </div>
    <div class="dialog-foot">
        <div class="save"><span class="ms-edit"></span><button type="submit" class="btn btn-success btn-sm" id="savebutton-edit">保存</button></div>
    </div>
    </form>
</div>
@endif
@else
{{-- 弹出对话框 登录 dialog --}}
<div class="dialog-popover dialog-login">
    <div class="dialog-poptit">
        <a title="关闭" class="close">×</a>
        <h3>登录夜读书 (<a href="{{url('usreg')}}">还没有注册？</a>)</h3>
    </div>    
    <div class="dialog-content">    
    <form id="ylogin" name="ylogin" class="cd-form" action="" method="post">
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
        <p class="fieldset">
            <label class="image-replace cd-username" for="signin-username">用户名</label>
            <input class="full-width has-padding has-border" name="username" id="username" placeholder="输入用户名" type="text">
        </p>
        <p class="fieldset">
            <label class="image-replace cd-password" for="signin-password">密码</label>
            <input class="full-width has-padding has-border" name="password" id="password" placeholder="输入密码" type="password">
        </p>
        <p class="fieldset">
            <input id="remember-me" checked="" type="checkbox">
            <label for="remember-me">记住登录状态</label><span class="u-tips u-dialog-err"><span class="ms-login"></span></span>            
        </p>
        <p class="fieldset">
            <button type="submit" class="btn btn-success btn-sm full-width" id="loginform">登录</button>
            </p>
    </form>            
    </div>
</div>
@endif
<div class="dialog-popover-mask"></div>
{{-- dialog end --}}

@include('books.partials.footer')
</body>
</html>
